package com.ruoyi.system.service.yanglao.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.yanglao.YlOldHealthMapper;
import com.ruoyi.system.domain.yanglao.YlOldHealth;
import com.ruoyi.system.service.yanglao.IYlOldHealthService;

/**
 * 老年养生Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-14
 */
@Service
public class YlOldHealthServiceImpl implements IYlOldHealthService 
{
    @Autowired
    private YlOldHealthMapper ylOldHealthMapper;

    /**
     * 查询老年养生
     * 
     * @param id 老年养生主键
     * @return 老年养生
     */
    @Override
    public YlOldHealth selectYlOldHealthById(Long id)
    {
        return ylOldHealthMapper.selectYlOldHealthById(id);
    }

    /**
     * 查询老年养生列表
     * 
     * @param ylOldHealth 老年养生
     * @return 老年养生
     */
    @Override
    public List<YlOldHealth> selectYlOldHealthList(YlOldHealth ylOldHealth)
    {
        return ylOldHealthMapper.selectYlOldHealthList(ylOldHealth);
    }

    /**
     * 新增老年养生
     * 
     * @param ylOldHealth 老年养生
     * @return 结果
     */
    @Override
    public int insertYlOldHealth(YlOldHealth ylOldHealth)
    {
        ylOldHealth.setCreateTime(DateUtils.getNowDate());
        return ylOldHealthMapper.insertYlOldHealth(ylOldHealth);
    }

    /**
     * 修改老年养生
     * 
     * @param ylOldHealth 老年养生
     * @return 结果
     */
    @Override
    public int updateYlOldHealth(YlOldHealth ylOldHealth)
    {
        ylOldHealth.setUpdateTime(DateUtils.getNowDate());
        return ylOldHealthMapper.updateYlOldHealth(ylOldHealth);
    }

    /**
     * 批量删除老年养生
     * 
     * @param ids 需要删除的老年养生主键
     * @return 结果
     */
    @Override
    public int deleteYlOldHealthByIds(Long[] ids)
    {
        return ylOldHealthMapper.deleteYlOldHealthByIds(ids);
    }

    /**
     * 删除老年养生信息
     * 
     * @param id 老年养生主键
     * @return 结果
     */
    @Override
    public int deleteYlOldHealthById(Long id)
    {
        return ylOldHealthMapper.deleteYlOldHealthById(id);
    }
}
